<?php

return [
    'create' => function() {
        return Yls::Db()->From('~User')->Insert();
    },
	'update' => function() {
		return true;
	},
	'read' => function() {
	    #$d = Yls::Db()->Fetch('SHOW CREATE TABLE --buz.-vip');
	    #Yls::Db()->From('^User');
	    #print_r($d->{'Create Table'});die;
	    #return Yls::Db('buz')->Fetch('SELECT * FROM User WHERE name LIKE "~User.id"');
	    #return Yls::Db('buz')->Fetch('select * from User where id = \'a~User\' and name = "yls"');
	    #return Yls::Db()->Fetch('SELECT ~~buz.~Vip.userId FROM ~~buz.~Vip LEFT JOIN User ON ~User.id = ~~buz.~Vip.userId WHERE User.id = "\'1aa" AND User.name LIKE "%y~ls%"');
	    
	    $User = Yls::Curd('User')->Create(['name' => 'keluo']);
	    echo $User->name;die;
	    $Vip = Yls::Curd('User')->Read('name = "yls"');
	    #var_dump($Vip);
	    #$Vip->Update(['gender' => 1]);
	    
	    echo $Vip->gender;
	    die;
	    return Yls::Db()->From('~User')->Order('id DESC')->Group('nick', 'ASC')->ReadAll();
    	$Criteria = new \Yls\Core\Criteria([
    	    'id' => '~User.id', // 对应当前数据库连接default中的yls.YUser表id字段(表示当前如果有id参数传递过来，则生成条件：yls.YUser.id = $id)
    	    'active' => '~focrs.~User.active', // 对应focrs连接中的focrs.FUser表的active字段(focrs.FUser.active = $active)
    	    'gender' => 'yls.YUser.gender', // 显式声明对应于yls数据库中的YUser表的gender字段(yls.YUser.gender = $type)
    	    'nick' => ['~User.nick' => 'LIKE'], // yls.YUser.nick LIKE "%'.$nick.'%"
    	]);
    	
		return [
			['id' => 1, 'name' => 'Yls'],
			['id' => 2, 'name' => 'Hello']
		];
	},
    'delete' => function() {
        return 'Delete method from '.__FILE__;
    }
];